package com.lsh.oms.core.dao.other;

import com.lsh.oms.api.model.query.QuerySignDto;
import com.lsh.oms.core.dao.MyBatisRepository;
import com.lsh.oms.core.model.order.OrderSignHead;
import com.lsh.oms.core.service.tool.Criteria;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author peter
 */
@MyBatisRepository
public interface OrderSignHeadMapper {

    int deleteByPrimaryKey(Long id);

    int insert(OrderSignHead record);

    int insertSelective(OrderSignHead record);

    OrderSignHead selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(OrderSignHead record);

    int updateByPrimaryKeyWithBLOBs(OrderSignHead record);

    int updateByPrimaryKey(OrderSignHead record);

    int updateByReceiptOrderId(OrderSignHead record);

    int updateHeadByReceiptOrderId(Map<String,Object> updateFields);

    int updatePayStatusByReceiptOrderId(OrderSignHead record);

    int updateExtByReceiptOrderId(OrderSignHead record);

    OrderSignHead selectByOrderCode(Long orderCode);

    OrderSignHead selectByReceiptOrderId(Long receiptOrderId);

    List<OrderSignHead> selectBatchByReceiptOrderId(Map<String, Object> codes);

    List<OrderSignHead> selectByTimes(@Param("startTime") Integer startTime, @Param("endTime") Integer endTime);

//    List<OrderSignHead> findSpecifiedBetween(@Param("startTime") Integer startTime, @Param("endTime") Integer endTime);

    List<OrderSignHead> findInvalidReceiptsBetween(@Param("startTime") Integer startTime, @Param("endTime") Integer endTime);

    int updateByTmsId(OrderSignHead record);

    int setValidByReceiptOrderId(OrderSignHead record);

    int updateReceiptTimeByReceiptOrderId(OrderSignHead record);

    Map<String, Object> findOrderSignByReceiptOrderId(@Param("receipt_order_id") Long receiptOrderId);

    List<OrderSignHead> findBaseOnCriteria(@Param("criteria") Criteria criteria, @Param("start") long start, @Param("limit") long limit);

    Long countBaseOnCriteria(@Param("criteria") Criteria criteria);

    Long countByFilter(QuerySignDto filter);
}